import request from '@/utils/request'
import apis from './'

export function getAllVideo (parameter) {
  return request({
    url: apis.AllVideo,
    method: 'get',
    params: parameter
  })
}

export function getLatelyVideo (parameter) {
  return request({
    url: apis.LatelyVideo,
    method: 'get',
    params: parameter
  })
}

export function getClass (parameter) {
  return request({
    url: apis.VideoClassList,
    method: 'get',
    params: parameter
  })
}

export function getVideoList (parameter) {
  return request({
    url: apis.VideoList,
    method: 'get',
    params: parameter
  })
}

export function getVideoClick (id) {
  return request({
    url: `${apis.VideoClick}?v_id=${id}`,
    method: 'get'
  })
}

export function postVideoClick (id, data) {
  return request({
    url: `${apis.VideoClick}?v_id=${id}`,
    method: 'post',
    data: data
  })
}

export function getMostVideo (parameter) {
  return request({
    url: apis.MostVideo,
    method: 'get',
    params: parameter
  })
}

export function videoRecord (parameter) {
  return request({
    url: apis.VideoRecord,
    method: 'get',
    params: parameter
  })
}

export function searchComplete (title) {
  return request({
    url: `${apis.SearchAutoComplete}?video_title=${title}`,
    method: 'get'
  })
}

export function getArticleList (parameter) {
  return request({
    url: apis.SearchArticleList,
    method: 'get',
    params: parameter
  })
}

export function getSearchComp (title) {
  return request({
    url: `${apis.SearchAuto}?title=${title}`,
    method: 'get'
  })
}

export function getHot (id, parameter) {
  return request({
    url: `${apis.HotArticle}?id=${id}`,
    method: 'get',
    params: parameter
  })
}
